<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        h1{
            text-align: center;
        }
        table{
            width: 685px;
            border-collapse: collapse;
            margin: 0 auto;
        }
        td,th{
            border: 1px solid pink;
            height: 35px;
        }
        tr:nth-child(odd){
            background-color: pink;
        }
        tr:hover{
            background-color: pink;
        }
        .p1{
            width: 650px;
            margin: 0 auto;
            text-align: right;
        }

    </style>
</head>
<body>
<h1>用户列表</h1>
<p class="p1">
    <a th:href="@{/user/view}">新增</a>
</p>
<table>
    <tr>
        <th>用户ID</th>
        <th>用户名</th>
        <th>密码</th>
        <th>年龄</th>
        <th>生日</th>
        <th>地址</th>
        <th>操作</th>

    </tr>
    <tr th:each="user:${userList}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.username}"></td>
        <td th:text="${user.password}"></td>
        <td th:text="${user.homeAddress}"></td>
        <td th:text="${#calendars.format(user.birthday,'yyyy-MM-dd')}"></td>

        <td th:text="${user.age}"></td>
        <td>
            修改
            |
            删除
        </td>
    </tr>
</table>

<p class="p1">
    <a th:href="@{'/user/1/'+${pageSize}}">首页</a>
    <a th:href="@{'/user/' + ${pageNO -1} + '/' + ${pageSize}}">上一页</a>
    <a th:href="@{'/user/' + ${pageNO +1} + '/' + ${pageSize}}">下一页</a>
</p>


</body>
</html>